package com.afc.struts.bustle.model;

import java.util.Date;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "product")
public class ProductDto
{
  public ProductDto(ProductType aProductType, ProviderDto aProvider, String aName, double aPrice, String aDescription, Date aCreationDate, Date aLimitedDate, String aImage)
  {
    super();
    productType = aProductType;
    provider = aProvider;
    name = aName;
    price = aPrice;
    description = aDescription;
    creationDate = aCreationDate;
    limitedDate = aLimitedDate;
    image = aImage;
  }

  public ProductDto()
  {
  }

  private int idProduct;

  private ProductType productType;

  private ProviderDto provider;

  private String name;
  private double price;
  private String description;
  private Date creationDate;
  private Date limitedDate;
  private String image;

  public String getImage()
  {
    return image;
  }

  public void setImage(String aImage)
  {
    image = aImage;
  }

  public int getIdProduct()
  {
    return idProduct;
  }

  public void setIdProduct(int idProduct)
  {
    this.idProduct = idProduct;
  }

  public ProviderDto getProvider()
  {
    return provider;
  }

  public void setProvider(ProviderDto provider)
  {
    this.provider = provider;
  }

  public String getName()
  {
    return name;
  }

  public void setName(String name)
  {
    this.name = name;
  }

  public double getPrice()
  {
    return price;
  }

  public void setPrice(double price)
  {
    this.price = price;
  }

  public String getDescription()
  {
    return description;
  }

  public void setDescription(String description)
  {
    this.description = description;
  }

  public Date getCreationDate()
  {
    return creationDate;
  }

  public void setCreationDate(Date creationDate)
  {
    this.creationDate = creationDate;
  }

  public Date getLimitedDate()
  {
    return limitedDate;
  }

  public void setLimitedDate(Date limitedDate)
  {
    this.limitedDate = limitedDate;
  }

  public ProductType getProductType()
  {
    return productType;
  }

  public void setProductType(ProductType productType)
  {
    this.productType = productType;
  }

  @Override
  public String toString()
  {
    return name;
  }

  public enum ProductType
  {
    Sport("Sport"),
    Culture("Culture"),
    Beaute("Bien-être");

    private String name;

    private ProductType(String name)
    {
      this.name = name;
    }

    public String getName()
    {
      return name;
    }

    public void setName(String name)
    {
      this.name = name;
    }

  }
}
